package com.ledi.guns.common.persistence.model;

import java.io.Serializable;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;

/**
 * <p>
 * 路由
 * </p>
 *
 * @author zhongxp
 * @since 2018-03-19
 */
@TableName("t_routes")
public class Routes extends Model<Routes> implements Serializable {

	/**
	 * 字段描述: [字段功能描述]
	 */
	private static final long serialVersionUID = 5718761488318699111L;

	@TableId(value = "id", type = IdType.AUTO)
	private Long id;

	/**
	 * 父id
	 */
	private Long pid;

	/**
	 * 排序
	 */
	@NotNull(message = "排序不能为空")
	@Min(1)
	private Integer num;
	/**
	 * 路由名称
	 */
	@NotBlank(message = "路由名称不能为空")
	private String name;
	/**
	 * 组件
	 */
	@NotBlank(message = "组件不能为空")
	private String component;
	/**
	 * 路径
	 */
	private String path;
	/**
	 * 图标class
	 */
	@TableField("iconCls")
	private String iconCls;
	/**
	 * 叶子
	 */
	private String leaf = "false";
	/**
	 * 是否隐藏
	 */
	private String hidden = "false";
	private String kye;
	private String pcode;

	@NotBlank(message = "code不能为空")
	private String code;

	public Long getId() {

		return id;
	}

	public void setId(Long id) {

		this.id = id;
	}

	public String getName() {

		return name;
	}

	public void setName(String name) {

		this.name = name;
	}

	public String getComponent() {

		return component;
	}

	public void setComponent(String component) {

		this.component = component;
	}

	public String getPath() {

		return path;
	}

	public void setPath(String path) {

		this.path = path;
	}

	public String getIconCls() {

		return iconCls;
	}

	public void setIconCls(String iconCls) {

		this.iconCls = iconCls;
	}

	public String getLeaf() {

		return leaf;
	}

	public void setLeaf(String leaf) {

		this.leaf = leaf;
	}

	public String getHidden() {

		return hidden;
	}

	public void setHidden(String hidden) {

		this.hidden = hidden;
	}

	public String getKye() {

		return kye;
	}

	public void setKye(String kye) {

		this.kye = kye;
	}

	@Override
	protected Serializable pkVal() {

		return id;
	}

	public Long getPid() {

		return pid;
	}

	public void setPid(Long pid) {

		this.pid = pid;
	}

	public String getPcode() {

		return pcode;
	}

	public void setPcode(String pcode) {

		this.pcode = pcode;
	}

	public String getCode() {

		return code;
	}

	public void setCode(String code) {

		this.code = code;
	}

	public Integer getNum() {

		return num;
	}

	public void setNum(Integer num) {

		this.num = num;
	}

}
